﻿@model NationalIT.Equipment
@{
    ViewBag.Title = "Equipment";
}
<div class="row-fluid">
    <div class="span12">
        <div class="box">
            <div class="box-title">
                <h3>
                    <i class="icon-table"></i>Equipment</h3>
            </div>
            <div class="box-content">
                <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
                <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
                @using (Html.BeginForm(null, null, FormMethod.Post, new { @class = "form-horizontal" }))
                {
                    @Html.ValidationSummary(true)                    

                    @Html.HiddenFor(model => model.ID)
                    
                    <div class="control-group">
                        <label class="control-label" for="Equipment_Type">
                            Equipment Type</label>
                        <div class="controls">
                            <div class="span12">
                                <select data-placeholder="Select Driver" name="Equipment_Type" class="input-xlarge">
                                    <option value="TRUCK" @(Model != null && !string.IsNullOrEmpty(Model.Equipment_Type) && Model.Equipment_Type.Equals("TRUCK") ? "selected='selected'" : "")>
                                        TRUCK</option>
                                    <option value="TRAILER" @(Model != null && !string.IsNullOrEmpty(Model.Equipment_Type) && Model.Equipment_Type.Equals("TRAILER") ? "selected='selected'" : "")>
                                        TRAILER</option>
                                </select>
                                @Html.ValidationMessageFor(model => model.Equipment_Type)
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="Equipment_number">
                            Equipment number</label>
                        <div class="controls">
                            <div class="span12">
                                @Html.TextBoxFor(model => model.Equipment_number, new { @class = "input-xlarge" })
                                @Html.ValidationMessageFor(model => model.Equipment_number)
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="Driver">
                            Driver</label>
                        <div class="controls">
                            <div class="span12">
                                <select data-placeholder="Select Equipment" name="Driver" class="chosen-with-diselect input-xlarge">
                                    @Html.Raw(ViewBag.dataDriver)
                                </select>
                                @Html.ValidationMessageFor(model => model.Driver)
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="Owner">
                            Owner</label>
                        <div class="controls">
                            <div class="span12">
                                <select data-placeholder="Select Equipment" name="Owner" class="chosen-with-diselect input-xlarge">
                                    @Html.Raw(ViewBag.dataOwner)
                                </select>
                                @Html.ValidationMessageFor(model => model.Owner)
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="EQUIPMENT_VALUE">
                            EQUIPMENT VALUE</label>
                        <div class="controls">
                            <div class="span12">
                                @Html.TextBoxFor(model => model.EQUIPMENT_VALUE, new { @class = "input-xlarge" })
                                @Html.ValidationMessageFor(model => model.EQUIPMENT_VALUE)
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="DATE_LEASED">
                            DATE LEASED</label>
                        <div class="controls">
                            <div class="span12">
                                @Html.TextBoxFor(model => model.DATE_LEASED, new { Value = Model != null && Model.DATE_LEASED.HasValue ? Model.DATE_LEASED.Value.ToString("MM/dd/yyyy") : "", @class = "input-xlarge date-picker" })
                                @Html.ValidationMessageFor(model => model.DATE_LEASED)
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="Inspection_Expiration">
                            Inspection Expiration</label>
                        <div class="controls">
                            <div class="span12">
                                @Html.TextBoxFor(model => model.Inspection_Expiration, new { Value = Model != null && Model.Inspection_Expiration.HasValue ? Model.Inspection_Expiration.Value.ToString("MM/dd/yyyy") : "", @class = "input-xlarge date-picker" })
                                @Html.ValidationMessageFor(model => model.Inspection_Expiration)
                            </div>
                        </div>
                    </div> 
                    <div class="control-group">
                        <label class="control-label" for="MAKE">@Html.LabelFor(model => model.MAKE)</label>
                        <div class="controls">
                            <div class="span12">
                                @Html.TextBoxFor(model => model.MAKE, new { @class = "input-xlarge " })
                                @Html.ValidationMessageFor(model => model.MAKE)
                            </div>
                        </div>
                    </div>    
                    <div class="control-group">
                        <label class="control-label" for="MODEL_YEAR">
                            MODEL YEAR</label>
                        <div class="controls">
                            <div class="span12">
                                @Html.TextBoxFor(model => model.MODEL_YEAR, new { @class = "input-xlarge " })
                                @Html.ValidationMessageFor(model => model.MODEL_YEAR)
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="Registration_Expiration">
                            Registration Expiration</label>
                        <div class="controls">
                            <div class="span12">
                                @Html.TextBoxFor(model => model.Registration_Expiration, new { Value = Model != null && Model.Registration_Expiration.HasValue ? Model.Registration_Expiration.Value.ToString("MM/dd/yyyy") : "", @class = "input-xlarge date-picker" })
                                @Html.ValidationMessageFor(model => model.Registration_Expiration)
                            </div>
                        </div>
                    </div>    
                    <div class="control-group">
                        <label class="control-label" for="VIN">@Html.LabelFor(model => model.VIN)</label>
                        <div class="controls">
                            <div class="span12">
                                @Html.TextBoxFor(model => model.VIN, new { @class = "input-xlarge" })
                                @Html.ValidationMessageFor(model => model.VIN)
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="VIN">@Html.LabelFor(model => model.LeaseAmount)</label>
                        <div class="controls">
                            <div class="span12">
                                <select name="LeaseAmount" class="input-xlarge">
                                    <option value="Daily" @(Model.LeaseAmount == "Daily" ? "Selected" : "")>Daily</option>
                                    <option value="Weekly" @(Model.LeaseAmount == "Weekly" ? "Selected" : "")>Weekly</option>
                                    <option value="Monthly" @(Model.LeaseAmount == "Monthly" ? "Selected" : "")>Monthly</option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="VIN">@Html.LabelFor(model => model.Status)</label>
                        <div class="controls">
                            <div class="span12">
                                <select name="Status" class="input-xlarge">
                                    <option value="Available" @(Model.Status == "Available" ? "Selected" : "")>Available</option>
                                    <option value="Leased" @(Model.Status == "Leased" ? "Selected" : "")>Leased</option>
                                    <option value="OOS" @(Model.Status == "OOS" ? "Selected" : "")>OOS</option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="InspectionFrequency">@Html.LabelFor(model => model.InspectionFrequency)</label>
                        <div class="controls">
                            <div class="span12">
                                @Html.TextBoxFor(model => model.InspectionFrequency, new { @class = "input-xlarge" })
                                @Html.ValidationMessageFor(model => model.InspectionFrequency)
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="LastInspected">
                            Last inspected</label>
                        <div class="controls">
                            <div class="span12">
                                @Html.TextBoxFor(model => model.LastInspected, new { Value = Model != null ? Model.LastInspected.ToString("MM/dd/yyyy") : "", @class = "input-xlarge date-picker" })
                                @Html.ValidationMessageFor(model => model.LastInspected)
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="InspectedBy">@Html.LabelFor(model => model.InspectedBy)</label>
                        <div class="controls">
                            <div class="span12">
                                @Html.TextBoxFor(model => model.InspectedBy, new { @class = "input-xlarge" })
                                @Html.ValidationMessageFor(model => model.InspectedBy)
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="OOS">@Html.LabelFor(model => model.OOS)</label>
                        <div class="controls">
                            <div class="span12">
                                @Html.CheckBoxFor(model => model.OOS)
                            </div>
                        </div>
                    </div>
                    <div class="form-actions">
                        @Html.Partial("_ShowSaveEdit")
                    </div>
                }
            </div>
        </div>
    </div>
</div>
